﻿@{
    Layout = null;
}



<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link href="~/Content/BootstrapSouce/css/H-ui.min.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="~/Content/BootstrapSouce/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="~/Content/BootstrapSouce/lib/Hui-iconfont/1.0.7/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="~/Content/BootstrapSouce/lib/icheck/icheck.css" />
    <link rel="stylesheet" type="text/css" href="~/Content/BootstrapSouce/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="~/Content/BootstrapSouce/static/h-ui.admin/css/style.css" />
    <script src="~/Content/BootstrapSouce/js/jquery.min.js"></script>
    <title></title>
</head>
<body>
    <div class="text-c">
        
        
        <input type="text" name="" id="name" placeholder="登记时的项目编号" style="width:250px" class="input-text">
        <button name="" id="" class="btn btn-success" type="submit" onclick="soso()"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
    </div>
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
            <!--垃圾桶-->   <!--<a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> </a>-->
            <!--<span><strong>登记</strong></span>-->
            <!--<a class="btn btn-primary radius" data-title="登记" data-toggle="modal"
            data-target="#myModal"><i class="Hui-iconfont">&#xe600;</i></a>-->
            @*<a onclick="self.parent.addTab('登记立项', '/Basic/Basic_Info', '')" class="btn btn-primary btn-lg" data-toggle="modal"
               data-target="#myModal">
                登记
            </a>*@
            <a class="btn btn-primary btn-lg" target="_self" href="/Basic/Basic_Info">登记</a>
        </span><span style="margin-left:42%">估价列表项目基本信息</span> <span class="r">共有数据：<strong>@ViewBag.count</strong> 条</span>
    </div>
    <div class="mt-20">
        <table class="table table-border table-bordered table-bg table-hover table-sort">
            <thead>
                <tr class="text-c">
                    <th width="30">房产登记编号</th>
                    <th width="30">所属部门</th>
                    <th width="30">借款人</th>
                    <th width="30">借款人联系电话</th>
                    <th width="20">贷款额度</th>
                    <th width="20">项目状态</th>
                    <th width="20">操作</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var i in Model)
                {
                    <tr class="text-c">
                        <td>@i.projectNumber</td>
                        <td>@i.department_Name</td>
                        <td>@i.loan_Name</td>
                        <td>@i.loan_TEL</td>
                        <td>@i.basic_Quota</td>

                        @switch ((int)i.basic_State)
                        {
                            case 0:
                                <td>
                                    待勘察
                                </td>
                                break;
                            case 1:
                            <td>
                                正在勘察
                            </td>
                                break;
                            case 2:
                            <td>
                                评估中
                            </td>
                                break;
                            case 3:
                            <td>
                                审核中
                            </td>
                                break;
                            case 4:
                            <td>
                                审核中
                            </td>
                                break;
                            case 5:
                            <td>
                                审核中
                            </td>
                                break;
                            case 6:
                            <td>
                                审核中
                            </td>
                                break;
                            case 7:
                            <td>
                                终审通过
                            </td>
                                break;

                        }
                        <td>
                            @if (i.basic_State < 1)
                            {

                                @*<input id="Button1" type="button" value="编辑" class="btn btn-primary" onclick="eidt(@i.projectNumber)" />*@<a href="#" onclick="delet(@i.projectNumber)">删除</a>
                            }
                           
                            @if (i.basic_State == 7)
                            {
                                <input id="Button1" type="button" value="导出" class="btn btn-primary" onclick="out(@i.projectNumber)"/>
                            }
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
    @if (ViewBag.pagecount > 1)
    {
        <a href="/basic/basic_show?pageindex=1&id=@ViewBag.id">首页</a>
        if (ViewBag.index == 1)
        {
            <a class="text-success">上一页</a>
        }
        else
        {
            <a href="/basic/basic_show?pageindex=@(ViewBag.index-1)&id=@ViewBag.id">上一页</a>
        }
        if (ViewBag.index == ViewBag.pagecount)
        {
            <a>下一页</a>
        }
        else
        {
            <a href="/basic/basic_show?pageindex=@(ViewBag.index+1)&id=@ViewBag.id">下一页</a>
        }
        <a href="/basic/basic_show?pageindex=@(ViewBag.pagecount)&id=@ViewBag.id">尾页</a>
    }
    <!--模态框-->

    <script src="~/Content/BootstrapSouce/lib/layer/2.1/layer.js"></script>
    <script type="text/javascript" src="~/Content/BootstrapSouce/lib/My97DatePicker/WdatePicker.js"></script>
    <!--<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>-->



</body>
</html>
<script>
    
    function delet(pro) {
        $.ajax({
            url: "http://localhost:63805/api/Basic_Info/" + pro,
            dataType: "json",
            type: "delete",
            success: function (obj) {
                if (obj > 0) {
                    alert('删除成功');
                    location.reload();
                }
                else {
                    alert('失败');
                }
            }
        })
    }
    function out(pro)
    {
        location.href='/basic/dot/'+pro;
    }
    function soso()
    {
        location.href = '/basic/basic_show?pageindex=1&where=' + $("#name").val() + "&id=" + localStorage.getItem("id");
    }
    
</script>
